.so ../bk-macros
.TH "bk checksum" "\*[BKVER]" %E% "\*(BC" "\*(UM"
.SH NAME
bk checksum \- check and/or fix \*(BK per file checksums
.SH SYNOPSIS
.B bk checksum 
.[OPTopt] \-s offset
.[B] -fv
.[OPTreq] \-r rev
.BKARGS
.SH DESCRIPTION
\*(BK has more integrity checksums than the original \*(SC had
(\*(SC had one over the whole s.file).
\*(BK maintains a checksum which is compatible with \*(SC and
also a set of new checksums, one per delta.
This command is typically used to check and/or regenerate the
per delta checksums.
Without any options, the default behavior is to just check each
checksum warn about any checksums that are missing or incorrect.
.LP
This command may also be used to print a list of checksums of
arbitrary data, see the
.B \-s
option.
.SH WARNING
The per delta checksums are part of the delta keys which are contained in 
the ChangeSet file.  These keys are part of the metadata which \*(BK uses
to group deltas into changesets.  If the checksums are changed, the checksums
in the ChangeSet file must be correspondingly changed, and the process
repeated for each copy of the repository.  Needless to say, we do not
encourage the use of this command with the
.B \-f 
option unless you are very sure of what you are doing.
.SH OPTIONS
.TP \-s[\*<off\*>]
.TP \-\-safe\-fix
.B \-f
fix any missing or incorrect checksums.
.tp
.OPTreq \-r rev
Limit checks to one revision.  Faster than checking the whole file if the
problem delta is known.
.tp
.OPTopt \-s off
generate and print the \*(SC style 16 bit unsigned checksum starting
at offset
.IR off .
If 
.I off 
is 8, then this generates the same checksum as the per file checksum.
If there are no file arguments, reads data from stdin (note: differs from
other options which obey the normal \*(BK file expansion rules).
.tp
.B \-\-safe\-fix
Only do fixes which do not alter the deltakey.
The fix removes an unneeded merge parent.
.tp
.B \-v
be verbose.
.SH "SEE ALSO"
.SA check
.SH WARNINGS
Do not depend on per file checksums being \*(SC compatible, \*(BK is likely
to move to a CRC in a future release.
.SH CATEGORY
.B Admin
